package com.bc.bcapi.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.math.BigInteger;

import com.bc.bcapi.dao.T_Mng_email_confMapper;
import com.bc.bcmodel.domain.T_Mng_email_confModel;

/**
 * @Name T_Mng_email_confService * @Description  * @Author generation * @Date 2018/9/12 15:29:31 * @Version 1.0
 **/
@Service
public class T_Mng_email_confService {
    @Resource
    T_Mng_email_confMapper t_Mng_email_confMapper;

    /**
     * 保存单条数据     *      * @return
     */
    public int insert(T_Mng_email_confModel req) {
        return t_Mng_email_confMapper.insert(req);
    }

    /**
     * 批量增加数据     *      * @return
     */
    public int insertBatch(List<T_Mng_email_confModel> req) {
        return t_Mng_email_confMapper.insertBatch(req);
    }

    /**
     * 根据对象属性查找满足条件的第一条数据     *      * @return
     */
    public T_Mng_email_confModel findByNamedParam(T_Mng_email_confModel req) {
        return t_Mng_email_confMapper.findByNamedParam(req);
    }

    /**
     * 根据对象查询所有数据     *      * @return
     */
    public List<T_Mng_email_confModel> getAllList(T_Mng_email_confModel req) {
        return t_Mng_email_confMapper.findByNamedParamList(req);
    }

    /**
     * 根据对象查询所有分页数据     *      * @return
     */
    public PageInfo<T_Mng_email_confModel> getList(T_Mng_email_confModel req) {
        PageHelper.startPage(req.getPage_index(), req.getPage_size());
        List<T_Mng_email_confModel> list = t_Mng_email_confMapper.findByNamedParamList(req);
        return new PageInfo<T_Mng_email_confModel>(list);
    }

    /**
     * 更新指定对象     *      * @return
     */
    public int update(T_Mng_email_confModel req) {
        return t_Mng_email_confMapper.update(req);
    }

    /**
     * 删除指定数据     *      * @return
     */
    public int delete(BigInteger id) {
        return t_Mng_email_confMapper.delete(id);
    }

    /**
     * 根据条件统计数据量     *      * @return
     */
    public long count(T_Mng_email_confModel req) {
        return t_Mng_email_confMapper.count(req);
    }
}